package com.ckh.springboot.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ckh.springboot.entity.HomeWorkTeacher;
import com.ckh.springboot.entity.User;
import com.ckh.springboot.mapper.HomeWorkTeacherMapper;
import com.ckh.springboot.mapper.UserMapper;
import com.ckh.springboot.service.IHomeWorkTeacherService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;

@Service
public class IHomeWorkTeacherServiceImpl extends ServiceImpl<HomeWorkTeacherMapper, HomeWorkTeacher> implements IHomeWorkTeacherService {
    @Resource
    private HomeWorkTeacherMapper homeWorkTeacherMapper;
    @Override
    public List<HomeWorkTeacher> getHomeWorkTeacherList(Integer id ) {
        List<HomeWorkTeacher> homeWorkTeacherList = homeWorkTeacherMapper.getHomeWorkTeacherList(id);
        return homeWorkTeacherList;
    }

    @Override
    public List<HomeWorkTeacher> getClassHomeWork(Integer id) {
        List<HomeWorkTeacher> homeWorkTeacherList = homeWorkTeacherMapper.getClassHomeWork(id);
        return homeWorkTeacherList;
    }

    @Override
    public int addHomeWorkTeacher(Integer classId, Integer teachId ,String title ,  String text , String banji ) {
        Integer submitcount = 0 ;
        Date createtime = new Date() ;
        System.out.println(createtime);
        int i = homeWorkTeacherMapper.addHomeWorkTeacher(classId, teachId, title, text , submitcount ,createtime , banji  );
        return i;
    }
}
